home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4684 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: news.tu-chemnitz.de!news
  2. From: hfst@hrz.tu-chemnitz.de (Hans Steffani)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Logical exclusive-or
  5. Date: 6 Feb 96 14:40:44 GMT
  6. Organization: University of Technology Chemnitz, FRG
  7. Message-ID: <4f7pgg$8rn@pyrrhus-f.hrz.tu-chemnitz.de>
  8. References: <4f6lrq$bcr@lastactionhero.rs.itd.umich.edu> <4f7688$4te@beach.and.nl>
  9. NNTP-Posting-Host: tantalus-f.hrz.tu-chemnitz.de
  10.  
  11. jos@and.nl (Jos A. Horsmeier) writes:
  12.  
  13. >Note that although the logical 'and' and 'or' operators do not 
  14. >evaluate their right operand if their left operand is false or
  15. >true resepectively, the 'logical exclusive or' operator must
  16. >evaluate both operands no matter what the value of the left hand
  17. >operand is. So the sole purpose of a '^^' operator would be a lexical
  18. >shorthand for: 
  19.  
  20. >    a ^^ b == (!(a) != !(b)) 
  21.  
  22. >That wouldn't be much of added functionality, would it?
  23.  
  24. Not and Or is enough.
  25.  
  26.        a && b == !( !a || !b )
  27.  
  28. h.f.s.
  29.  
  30.  
  31. --
  32. Hans Friedrich Steffani
  33. Institut fuer Elektrische Maschinen und Antriebe
  34. TU Chemnitz-Zwickau
  35. e-mail: hans.steffani@e-technik.tu-chemnitz.de
  36.